Breadth first search
Shortest path with alternating colors
algorithm breadth first search
Comments CountProblem description
Consider a directed graph, with nodes labelled 0, 1, …, n-1. In this graph, each edge is either red or blue, and there could be self-edges or parallel edges.
Course Schedule II (LC210)
leetcode algorithm topological sort breadth first search depth first search
Comments CountProblem description
There are a total of n courses you have to take, labeled from 0 to n-1.
Course Schedule (LC207)
leetcode algorithm topological sort depth first search breadth first search
Comments CountProblem description
There are a total of n courses you have to take, labeled from 0 to n-1.